import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["className", "linkElement", "type", "title", "desc", "img", "actions"];
import React, { createElement } from 'react';
import classNames from 'classnames';
import config from "./typeConfig";
import styles from "./index.less?modules";

var Exception = function Exception(_ref) {
  var className = _ref.className,
      _ref$linkElement = _ref.linkElement,
      linkElement = _ref$linkElement === void 0 ? 'a' : _ref$linkElement,
      type = _ref.type,
      title = _ref.title,
      desc = _ref.desc,
      img = _ref.img,
      actions = _ref.actions,
      rest = _objectWithoutProperties(_ref, _excluded);

  var pageType = type in config ? type : '404';
  var clsString = classNames(styles.exception, className);
  return /*#__PURE__*/React.createElement("div", Object.assign({
    className: clsString
  }, rest), /*#__PURE__*/React.createElement("div", {
    className: styles.imgBlock
  }, /*#__PURE__*/React.createElement("div", {
    className: styles.imgEle,
    style: {
      backgroundImage: "url(".concat(img || config[pageType].img, ")")
    }
  })), /*#__PURE__*/React.createElement("div", {
    className: styles.content
  }, /*#__PURE__*/React.createElement("h1", null, title || config[pageType].title), /*#__PURE__*/React.createElement("div", {
    className: styles.desc
  }, desc || config[pageType].desc && config[pageType].desc()), /*#__PURE__*/React.createElement("div", {
    className: styles.actions
  }, actions || createElement(linkElement, {
    to: '/',
    href: '/'
  }))));
};

export default Exception;